﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZiChen.SoXunLeiPan.Resources.Converters.ErrorConvert
{
    public class ErrorTypeToMessageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (int)value switch
            {
                1 => "网络连接失败，请检查您的网络后重试。",
                2 => "未找到文件信息，可能已删除或已失效。",
                3 => "该资源可能存在违禁内容，需人工审核后你才能访问，请等待审核（工作日24小时内审核完毕），或立即联系在线客服解决。",
                4 => "服务器内部错误，请稍后再试。",
                _ => "发生未知错误，请重试。"
            };
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
